package com.sfh.cpc.user.model;

import android.content.Context;

import com.sfh.cpc.com.BaseAppContent;
import com.sfh.cpc.com.entity.EUser;
import com.sfh.cpc.com.server.INoteServer;
import com.sfh.cpc.com.server.IUserServer;
import com.sfh.cpc.user.LoginActivity;
import com.sfh.cpc.user.UserVipActionActivity;
import com.sfh.lib.AppCacheManager;

/**
 * 功能描述: TODO
 *
 * @author SunFeihu 孙飞虎
 * @date 2018/8/30
 */
public class UserServer implements IUserServer {
    @Override
    public void openUserInfo(Context context, long userId) {
    }

    @Override
    public void openVip(Context content,long dataId,int type) {
        // 判断是否登录
        EUser user = AppCacheManager.getCache(BaseAppContent.USER, EUser.class);
        if(user == null){
            LoginActivity.startUI(content);
        }else{
            UserVipActionActivity.startUI(content,dataId,type);
        }
    }

    @Override
    public void openLogin(Context context) {
        LoginActivity.startUI(context);
    }
}
